package com.zzy.jkb.constant;

public class JkbConstant {

    public enum NeedlesNum {
        ONE(1, "第一针"), TWO(2, "第二针"), THREE(3, "第三针");
        private int code;
        private String msg;

        NeedlesNum(int code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        public static String getMessage(Integer code) {
            for (NeedlesNum needlesNum : NeedlesNum.values()) {
                if (needlesNum.getCode() == code) {
                    return needlesNum.getMsg();
                }
            }
            return null;
        }

        public static Integer getValueCode(String msg) {
            for (NeedlesNum needlesNum : NeedlesNum.values()) {
                if (needlesNum.getMsg().equalsIgnoreCase(msg)) {
                    return needlesNum.getCode();
                }
            }
            return null;
        }

        public int getCode() {
            return code;
        }

        public String getMsg() {
            return msg;
        }
    }

    public enum ProductStatusEnum {
        NEW_SPU(0, "新建"),
        SPU_UP(1, "商品上架"),
        SPU_DOWN(2, "商品下架");

        private int code;

        private String msg;

        public int getCode() {
            return code;
        }

        public String getMsg() {
            return msg;
        }

        ProductStatusEnum(int code, String msg) {
            this.code = code;
            this.msg = msg;
        }

    }


}
